package com.rec.repository;

import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.data.jpa.repository.Modifying;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;

import com.rec.entity.Teachers;

public interface TeachersRepository extends JpaRepository<Teachers,Integer>,
JpaSpecificationExecutor<Teachers>{
	
	@Query(value="select * from teachers s where s.cardno = :cardno",nativeQuery = true)
	Teachers findByCardno(@Param("cardno")String cardno);
	
	@Modifying
	@Query(value="update teachers s set s.status = :id where s.cardno = :cardno ",nativeQuery = true)
	Integer updateStatus(@Param("cardno")String cardno, @Param("id")Integer id);

}
